package com.quectel.emp.vo.scheduling;

import com.quectel.core.module.dept.dto.DeptPersonDto;
import com.quectel.core.module.scheduling.dto.SchedulingAttendanceDailyTimeDto;
import com.quectel.core.module.scheduling.dto.SchedulingAttendanceGroupDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 在这里编写说明
 *
 * @author: ryan
 * @email: ryan.ran@quectel.com
 * @date: 2023-07-13 19:37:00
 */

@Data
@Schema
public class DailyPreCheckResp {
    @Schema(description = "日期 yyyy-MM-dd")
    private String date;
    @Schema(description = "星期")
    private String weekName;
    @Schema(description = "考勤状况类型 1班 2休 3假期 4出差 5外出")
    private Byte situationType;
    @Schema(description = "考勤状况")
    private String situation;
    @Schema(description = "特殊考勤状况时间段")
    private String[] situationTimeSlot;
    @Schema(description = "是否外勤 1 是 0 否 (外勤打卡图标显示)")
    private Byte isField;
    @Schema(description = "员工")
    private DeptPersonDto person;
    @Schema(description = "考勤组信息")
    private SchedulingAttendanceGroupDto attendanceGroup;
    @Schema(description = "负责人列表")
    private List<DeptPersonDto> headers;
    @Schema(description = "打卡列表")
    private List<CheckTimeCls> checks;
    @Schema(description = "考勤规则描述")
    private AttendanceRuleDescCls attendanceRuleDesc;

    @Schema
    @Data
    public static class AttendanceRuleDescCls{
        @Schema(description = "考勤时间描述")
        private AttendanceRuleDescChunk<?> checkTimeDesc;
        @Schema(description = "加班规则描述")
        private AttendanceRuleDescChunk<List<AttendanceRuleDescChunk<?>>> overtimeDesc;
        @Schema(description = "考勤组描述")
        private AttendanceRuleDescChunk<?> groupDesc;
    }

    @Schema
    @Data
    public static class AttendanceRuleDescChunk<T>{
        @Schema(description = "标题")
        private String title;
        @Schema(description = "内容")
        private String content;
        @Schema(description = "扩展内容")
        private T extend;
    }

    @Schema
    @Data
    public static class CheckTimeCls{
        @Schema(description = "时间段名称")
        private String schedulingName;
        @Schema(description = "上班打卡信息")
        private CheckTimeItemCls workItem;
        @Schema(description = "下班打卡信息")
        private CheckTimeItemCls closingItem;
    }

    @EqualsAndHashCode(callSuper=true)
    @Schema
    @Data
    public static class CheckTimeItemCls extends SchedulingAttendanceDailyTimeDto.FieldCheckDataCls {
        @Schema(description = "要求时间")
        private Date time;
        @Schema(description = "有效打卡时间")
        private Date checkTime;
        @Schema(description = "打卡状态")
        private Byte checkStatus;
        @Schema(description = "打卡是否外勤 0否 1 是")
        private Byte checkIsField;
        @Schema(description = "打卡是否补卡 0否 1 是")
        private Byte checkIsRepair;
        @Schema(description = "打卡地址")
        private String checkAddress;
    }
}
